<script type="text/javascript" src="/assets/js/mochikit/MochiKit.js"></script>
<script type="text/javascript" src="/assets/js/plotkit/Base.js"></script>
<script type="text/javascript" src="/assets/js/plotkit/Layout.js"></script>
<script type="text/javascript" src="/assets/js/plotkit/Canvas.js"></script>
<script type="text/javascript" src="/assets/js/plotkit/SweetCanvas.js"></script>

<?
$options = array();
array_push($options, "A");
array_push($options, "B");
array_push($options, "C");

$index = 0;
foreach ($options as $option) {
    $ticks = $ticks."{v:".$index.", label:".$option."}";
    if ($index++ < sizeof($options) - 1) {
        $ticks = $ticks.",";
    }
}
echo $ticks;
?>

<script type="text/javascript">
 
var options = {
   "IECanvasHTC": "/plotkit/iecanvas.htc",
   "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[3]),
   "padding": {left: 0, right: 0, top: 10, bottom: 30},
   "xTicks": [{v:0, label:"zero"}, 
          {v:1, label:"one"}, 
          {v:2, label:"two"},
          {v:3, label:"three"},
          {v:4, label:"four"}],

   "drawYAxis": false
};

function drawGraph() {
    var layout = new PlotKit.Layout("pie", options);
    layout.addDataset("sqrt", [[0, 5], [1, 1], [2, 1.414], [3, 1.73], [4, 2]]);
    layout.evaluate();
    var canvas = MochiKit.DOM.getElement("graph");
    var plotter = new PlotKit.SweetCanvasRenderer(canvas, layout, options);
    plotter.render();
}
MochiKit.DOM.addLoadEvent(drawGraph);


</script>

<div><canvas id="graph" height="300" width="300"></canvas></div>

